import { fetchPostData, fetchGetData } from '@/api/fetch'
import { setToken, getToken, setCookie, getCookie, getFormParams } from '@/libs/util'

const state = {
    city: "上海",
    selectedTab: 'home',
    token: getToken(),
    user: "",
}
try {
    if (localStorage.userId) {
        fetchGetData('/api/user/detail', { id: localStorage.userId })
            .then(data => {
                console.log(data);
                state.user = data.data;
                if (data.data.cityName != null) {
                    state.city = data.data.cityName;
                }
            })
    }
} catch (error) {

}
export default state;